/*
 * Tencent is pleased to support the open source community by making ovCompose available.
 * Copyright (C) 2025 Tencent. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#import "TMMPictureRecorderDrawingItem.h"
#import <Foundation/Foundation.h>

#ifdef __cplusplus

#import <stack>
#import <vector>

NS_ASSUME_NONNULL_BEGIN

namespace TMM {

/// 用于记录图片绘制命令的 diff Range
struct RangeIndexs {
    NSInteger from;
    NSInteger to;
};

/// 用于记录图片绘制命令的 diff 结果
struct DiffResult {
    std::vector<NSInteger> deletsItems;
    std::vector<NSInteger> updatedItems;
    std::vector<NSInteger> insertItems;
    std::vector<RangeIndexs> movedItems;
};

/// 对新旧数组进行 diff
/// - Parameters:
///   - oldArray: 老数组
///   - newArray: 新数组
DiffResult diffDrawCommands(const std::vector<DrawingItem> &oldArray, const std::vector<DrawingItem> &newArray);

}; // namespace TMM

NS_ASSUME_NONNULL_END

#endif
